<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<title>${name_china}管理列表</title>
<%@include file="/common/head.jsp" %>

<!-- 时间日期插件 -->
<link href="<%=request.getContextPath()%>/static/plugin/My97DatePicker/skin/default/datepicker.css" rel="stylesheet" >
<script src="<%=request.getContextPath()%>/static/plugin/My97DatePicker/WdatePicker.js"></script>
<style>
	.deliertitle{
		font-size:16px;
		color:#323232;
	}
	html,body{background:#eff3f6;}
	/***订单来源**/
	.orderoot{padding:10px 0px;overflow:auto;zoom:1}
	.ordernum{width:49.7%;float:left;background:#fff;padding: 12px 0px;height:345px;}
	.orderlogist{width:49.5%;float:left;margin-left:8px;padding: 12px 0px;background:#fff;height:345px;overflow: auto;}
	.sameorder{line-height: 24px;display: block;padding: 3px 16px;}
	.addnotes{margin-left: 10px;color: #1f95ef;text-decoration: underline;cursor: pointer;}
	.delaybut{width:120px;height:36px;background:#8191a6;text-align:center;line-height:36px;color:#fff;margin:0 auto;}
	/****物流****/
	.orderlogtitle{padding:3px 16px;}
	.toolfont{padding:3px 16px;color:#ff2040;}
	.goodorder{padding:3px 16px;}
	.samegoodcode{}
	.selcheckbox{position: relative;top: 3px;margin-right: 10px;}
	.samefiled{padding:3px 16px;}
	.confirmbut{
	width:100px;height:36px;line-height:36px;text-align:center;
	color:#fff;background:#1f95ef;margin-left:174px;margin-top: 10px;}
	.submitbut{
	    margin: 0 auto;
	    position: relative;
	    width: 100px;
	    height: 36px;
	    line-height: 36px;
	    text-align: center;
	    color: #fff;
	    margin-left: 174px;
	    margin-top: 10px;
	}
	/****信息地址消息****/
	.inforlist{padding:16px;background:#fff;}
	.inforlist-ul{width:100%;overflow:auto;zoom:1;}
	.sameinfor-li{width:40%;float:left;background:#fff;}
	.sameinfotitle{line-height: 20px;}
	.sametext{line-height:22px;display:block;}
	.revisebut{color: #ff2040;text-decoration: underline;margin-left: 35px;cursor:pointer;}
	.checkbut{color: #1f95ef;text-decoration: underline;margin-left: 156px;cursor:pointer;}
	.remarkcon{width:80%;height:90px;border: solid 1px #ccc;margin-top: 11px;}
	/*****商品视图******/
	.goodview{padding:16px;background:#fff;margin-top:25px;}
	.summer-datagrid-cell>img{width:120px;height:120px;}
	.termcon{margin-top:40px;}
	.sameterm{line-height:20px;display:block;text-align: right;}
	.samenum{margin-left:12px;}
	.allprice{color:#ff2040;font-size:18px;}
	/*****提示框*****/
	.tooltitle{
	    border-bottom: solid 1px #323232;
	    width: 93%;
	    margin: 0 auto;
	    text-align: left;
	    padding: 0;
	    margin-bottom: 10px;
	}
	.toolbox{
	    width: 90%;
	    height: 100px;
	    background: #fff;
	    margin-left: 21px;
	    overflow: auto;
	    border: solid 1px #ccc;
	}
	.btn{
		 background-color: #02d1cf;
  		  color: #fff;
	}
</style>
</head>
<body class="iframe-page">
<div class="page-title-wrapper">
    <div class="page-title">
        <div class="page-title-text">
            <span>待发货详情页管理</span>
        </div>
        <div id="toolbar" style="float: right"></div>
        <a id="goBack" class="btn-return distance-left" href="javascript:;"><i class="icon icon-arrow-left"></i>返回上级</a>
    </div>
    <div class="page-title-border"></div>
</div>
<!-- -发货内容- -->
<form id="form" method="post">
<div class="orderoot">
	<div class="ordernum">
		<span class="sameorder"><input type="hidden" id ="userId" name="userId" value="" ></span>
		<span class="sameorder">订单号：<input type="text" id ="orderNo" name="orderNo" value="" ></span>
		<span class="sameorder">订单状态：<input type="text" id= "state" name="state" value="" ></span>
		<span class="sameorder">订单来源：<input type="text" id="source" name="source" value="" ></span>
		<span class="sameorder">备注：<input type="text" id="note" name="note" value="" ><a id="addnotes" class="addnotes">添加备注</a></span>
		<div class="delaybut">延迟发货提醒</div>
		<span class="sameorder tooltitle">用户提示发货记录</span>
		
		<div id="remindBox" class="toolbox">
		</div>
		
	</div>
	<div class="orderlogist">
	<div  id="orderItem">
		<h4 class="orderlogtitle">物流</h4>
		<label class="toolfont">商品编码默认是全选,如果不同物流或发货时间，请单独选择</label>
		<div id="itemIdDetail" class="goodorder">
		</div>
		<div class="samefiled">
			<span>物流公司：</span>
			<input type="text" class="summer-input summer-combobox-text" name="expressId" id="expressId" readonly="readonly" style="margin: 0px;">
		</div>
		<div class="samefiled">
			<span>　运单号：</span>
			<input type="text" class="summer-input summer-combobox-text" name="expressNo" id="expressNo" style="margin: 0px;">
		</div>
		<div class="samefiled">
			<span>　包裹数：</span>
			<input type="text" class="summer-input summer-combobox-text" name="expressPacnum" id="expressPacnum" style="margin: 0px;">
		</div>
		<div  class="submitbut">
		<a class="btn btn-normal" id="saveBtn">保存</a>
		</div>
		</div>
	</div>
</div>
</form>

<!-- -个人信息- -->
<div class="inforlist">
	<ul class="inforlist-ul">
		<li class="sameinfor-li">
			<h4 class="sameinfotitle">收货人信息</h4>
			<span class="sametext">联系买家:<input type="text" id="addruserNickName" name="addruserNickName" value="" ></span>
			<span class="sametext">收货人:<input type="text" id="receiverName" name="receiverName" value="" ></span>
			<span class="sametext">地址:<input type="text" id="address" name="address" value="" ></span>
			<span class="sametext">手机号：<input type="text" id="receiverPhone" name="receiverPhone" value="" > 
			<a class="revisebut" id="editReceive">修改</a></span>
			<a class="checkbut">点击查看</a>
			<textarea class="remarkcon"></textarea>
		</li>
		
		<li class="sameinfor-li">
			<h4 class="sameinfotitle">付款信息</h4>
			<span class="sametext">付款方式：<input type="text" id="payType" name="payType" value="" ></span>
			<span class="sametext">付款时间:<input type="text" id="payTime" name="payTime" value="" ></span>
			<span class="sametext">商品总额:<input type="text" id="sumAmount" name="sumAmount" value="" ></span>
			<span class="sametext">红包优惠:<input type="text" id="couponAmount" name="couponAmount" value="" ></span>
			<span class="sametext">优惠券:<input type="text" id="syscouponAmount" name="syscouponAmount" value="" ></span>
			<span class="sametext">惠金币:<input type="text" id="score" name="score" value="" ></span>
			<span class="sametext">余额：<input type="text" id="balance" name="balance" value="" ></span>
			<span class="sametext">实际金额:<input type="text" id="actualPay" name="actualPay" value="" ></span>
			
		</li>
	</ul>
</div>

<!-- -商品- -->

<div class="goodview">
	<div class="summer-datagrid-wrap" style="width: 100%;">
    	<div class="summer-datagrid-body" style="width: 100%;">
    			<div class="summer-datagrid-body-inner">
    				<table class="summer-datagrid" id="orderItemsTab">
    				<thead>
					    <tr>
					        <th><div class="summer-datagrid-cell" >商品名称/编号</div></th>
					        <th><div class="summer-datagrid-cell" >商品属性</div></th>
							<th><div class="summer-datagrid-cell" >状态</div></th>
							<th><div class="summer-datagrid-cell" >商品单价</div></th>
							<th><div class="summer-datagrid-cell" >商品数量</div></th>
							<th><div class="summer-datagrid-cell" >佣金比例/佣金</div></th>
							<th><div class="summer-datagrid-cell" >库存状态</div></th>
							<th><div class="summer-datagrid-cell" >商品总价</div></th>
					    </tr>
				    </thead>
   						 <tbody id="orderItemDetail">
   						 	
   						 </tbody>
   				   </table>
   				</div>
   		</div>
	</div>	
	<!-- -商品价钱- -->
	<div class="termcon" id="bottom">
		
	</div>
</div>
<script>
	//请求url
	var CONST_URL = {
		LIST: basePath + '${common_url}list',
	   	INIT_ADD: basePath + "${common_url}initAdd",
	   	INIT_EDIT: basePath + "${common_url}initEdit",
	   	INIT_VIEW: basePath + "${common_url}initView",
	   	INIT_MAIN: basePath + "${common_url}init",
	   	DEL: basePath + "${common_url}delete",
	   	EXP: basePath + "${common_url}exp",
	   	INIT_SEND_EXPRESS: basePath + "${common_url}initSendExpress",
/* 	   	INIT_IMP: basePath + "${common_url}initImp";
 */	   	SEND_EXPRES: basePath + "${common_url}sendExpress",
 		ADD_NOTE: basePath + "${common_url}addnote",
 		EDIT_RECEIVE: basePath + "${common_url}editReceiveMsg",
 		GET_EXPRESS_ID: basePath + "${common_url}getProjectExpress"
	};
	 var   editData,
	 orderNo,
	 source,
	 state,
	 
	 note,
	 ordersRmindViewVo,
	 payViewVo,
	 useraddressViewVo,
	 itemlist,
	 skulist,
	 payType,
	 itemId,
	 userNickName,
	 createTime,
	 userId,
	 msg,
	 skuId,
	 orderItemAllVo,
	 orderitemsList,
	 orderRemindList,
	 item_sumAmount,
	 item_skuId,
	 item_goodsName,
	 item_goodsImg,
	 item_goodsParam,
	 item_state,
	 item_price,
	 item_count,
	 item_yjPercent,
	 item_yjAmount,
	 item_stock,
	 rowCount,
	 html,
	 permission = CommonUtil.getPermission('${name_english}');
     
    $(function () {
    	editData = ${editData};
    	orderNo = editData[0].orderNo;
    	source = editData[0].source;
    	state = editData[0].state;
    	note = editData[0].note;
    	userId = editData[0].userId;
    	ordersRmindViewVo = editData[0].ordersRmindViewVo;
    	payViewVo = editData[0].payViewVo;
    	useraddressViewVo = editData[0].useraddressViewVo;
    	itemlist = editData[0].itemlist;
    	skulist = editData[0].skulist;
    	orderRemindList = editData[0].orderRemindList;
    	payType = payViewVo.payType;
    	orderItemAllVo = editData[0].orderItemAllVo;
    	orderitemsList = orderItemAllVo.list;
    	sumAmount = orderItemAllVo.sumAmount;
    	$("#orderNo").val(orderNo);
    	$("#state").val(state);
    	$("#source").val(source);
    	$("#note").val(note);
    	$("#userId").val(userId);

    	for(var l=0;l<orderitemsList.length;l++){
    		 html = '<tr>'
			 		+'<td><div class="proleft">商品编号：'+orderitemsList[l].skuId+'<br/>新的商品</div><div class="proright"><p>商品名称：'+orderitemsList[l].goodsName+'<br/></p><img width="100" height="100" src="'+orderitemsList[l].goodsImg+'"></td>'
		 			+'<td><div class="summer-datagrid-cell" >商品属性：'+orderitemsList[l].goodsParam+'<br/>新的商品</div></td>'
		 			+'<td><div class="summer-datagrid-cell">状态：'+orderitemsList[l].state+'<br/></div></td>'
		 			+'<td><div class="summer-datagrid-cell">商品单价：'+orderitemsList[l].price+'<br/></div></td>'
		 			+'<td><div class="summer-datagrid-cell">商品数量：'+orderitemsList[l].count+'<br/></div></td>'
		 			+'<td><div class="summer-datagrid-cell"><p>佣金比例：'+orderitemsList[l].yjPercent+'<br/></p><p>佣金金额：'+orderitemsList[l].yjAmount+'<br/></p></div></td>'
		 			+'<td><div class="summer-datagrid-cell" >库存状态：'+orderitemsList[l].stock+'<br/></div></td>'
		 			+'<td class="row2"><div class="summer-datagrid-cell">总计金额：'+sumAmount+'<br/></div></td>' 
		 			+'</tr>';
    		 //<td><div class="summer-datagrid-cell">商品编号：100000<br/>新的商品</div></td>
    		 $("#orderItemDetail").append(html);
    		 		 
    	}
    	if(orderitemsList.length == 0){
    		$("#orderItem").css("display","none");
    	}
    	if(orderitemsList.length != 1){
    		var rownum = orderitemsList.length;
			var num = orderitemsList.length;
    		for(var m=0;m<num;m++){
    			var n = $('.row2').length-1;
    			if(n != 0){
    				$('.row2').eq(n).remove();
                	$('.row2').attr('rowspan',rownum);
    			}
    		}
    	}

    	for(var i=0;i<orderRemindList.length;i++){
    		var remindHTML = '<div class="samegoodcode">昵称：'+orderRemindList[i].userNickName+' 创建时间：'+orderRemindList[i].createTime+'消息：'+orderRemindList[i].msg+'</div>';
        	//remindBox
    		$("#remindBox").append(remindHTML); 
    		

    	}
    	/* for(var j=0;j<itemlist.length;j++){
    		itemId = itemlist[j];
    		$(itemIdDetail).append('<div class="samegoodcode"><input type="hidden" name="itemId'+ j +'" id="itemId'+ j +'" value="'+itemId+'"/></div>'); 
    	} */
    	for(var k=0;k<skulist.length;k++){
    		skuId = skulist[k];
    		$(itemIdDetail).append('<div class="samegoodcode"><input type="checkbox" checked value="'+skuId+'" name="skuId'+ k +'" id="skuId'+ k +'" class="selcheckbox" >商品编号：<input type="text" value="'+skuId+'"/></div>'); 
    	}
    	$("#payType").val(payType);
    	$("#payTime").val(payViewVo.payTime);
    	$("#sumAmount").val(payViewVo.sumAmount);
    	$("#couponAmount").val(payViewVo.couponAmount);
    	$("#syscouponAmount").val(payViewVo.syscouponAmount);
    	$("#score").val(payViewVo.score);
    	$("#balance").val(payViewVo.balance);
    	$("#actualPay").val(payViewVo.actualPay);
    	$("#receiverName").val(useraddressViewVo.receiverName);
    	$("#address").val(useraddressViewVo.address);
    	$("#receiverPhone").val(useraddressViewVo.receiverPhone);
    	$("#addruserNickName").val(useraddressViewVo.userNickName);
    	//最底部订单支付信息
        var bottomHtml = '<div class="sameterm">商品总价：'+payViewVo.sumAmount+'<br/></div>'
                +'<div class="sameterm">红包优惠：'+payViewVo.couponAmount+'<br/></div>'
                +'<div class="sameterm">优惠券：'+payViewVo.syscouponAmount+'<br/></div>'
                +'<div class="sameterm">惠金币：'+payViewVo.score+'<br/></div>'
                +'<div class="sameterm">应付金额：'+payViewVo.actualPay+'<br/></div>';              
        $("#bottom").append(bottomHtml);
    	//初始化下拉选项
    	 //初始化下拉选项  商品所属公司
         $('#expressId').combobox({
               url : CONST_URL.GET_EXPRESS_ID, 
               valueField : 'id',
               async:false,
               textField : 'expressCompany'
           });
    	
		//返回按钮
    	$('#goBack').on('click',backMain);
        // 查询按钮
        $('#search').on('click', reloadTable);
        $('#addnotes').on('click',addNote);
        // 		EDIT_RECEIVE: basePath + "${common_url}editReceiveMsg"
            var iWidth;                         //弹出窗口的宽度;
            var iHeight;                        //弹出窗口的高度;
            var iTop = (window.screen.height-60-iHeight)/2;       //获得窗口的垂直位置;
            var iLeft = (window.screen.width-20-iWidth)/2;        //获得窗口的水平位置;
        $('#editReceive').on('click', function() {     
            var $this = $(this),
            orderNo = $this.closest('tr').find('td[data-field="orderNo"]').attr('data-value');
            userId = $this.closest('tr').find('td[data-field="userId"]').attr('data-value');
            window.open(CONST_URL.EDIT_RECEIVE+'?orderNo=' + orderNo+"&userId+"+userId,'newwindow','height='+iHeight+',innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no') ;
        });	
        //重置按钮
        $('#reset').on('click', function () {
        	//重置文本框的值
        	$('#status').combobox('clear');
        	$('#orderNum').val('');
        	//$('#startTime').val(''); 
        	
        	//$('#stopTime').val('');
        	
        	reloadTable();
        });
        
        //新建
        $('#toolbar').on('click', 'a[data-permit="${name_english}:initAdd"]', function() {
        	window.location.href = CONST_URL.INIT_ADD; 	  	
		});
        
        
       createTable();
        
        //查看
        $('#t-wrap').on('click', 'a[data-permit="${name_english}:initView"]', function() {
        	var $this = $(this),
        	    id = $this.closest('tr').find('td[data-field="id"]').attr('data-value');
        	window.location.href = CONST_URL.INIT_VIEW +"?id=" + id;
        });
       
        //编辑
        $('#t-wrap').on('click', 'a[data-permit="${name_english}:initEdit"]', function() {
            var $this = $(this),
                id = $this.closest('tr').find('td[data-field="id"]').attr('data-value');
            window.location.href = CONST_URL.INIT_EDIT + '?id=' + id;
        });	
        
        //删除
		$('#t-wrap').on('click', 'a[data-permit="${name_english}:delete"]', function() {
			var $this = $(this),
			    id = $this.closest('tr').find('td[data-field="id"]').attr('data-value');
			$.sdialog({
				type: 'confirm',
				msg: '您确定要删除选中的记录吗?',
				onConfirm: function(result) {
				    if (result) {
				    	$.sajax({
			                url : CONST_URL.DEL + "?ids=" + id,
			                onLoadSuccess : function() {
			                	 $.stip({
                	                type:'ok',//显示类型 有info、 ok、 danger
                	                text: '删除成功！'    
			                	});
			                	reloadTable();  
			                }
			            });
				    		
				    }	
				}
			});
		});
        
        
		//发货
		$('#t-wrap').on('click', 'a[data-permit="${name_english}:initSendExpress"]', function() {
			  var $this = $(this),
              id = $this.closest('tr').find('td[data-field="id"]').attr('data-value');
              window.location.href = CONST_URL.INIT_SEND_EXPRESS + '?id=' + id;
		});
		
		 //导出 
        $('#toolbar').on('click', 'a[data-permit="${name_english}:exp"]', function() {
        	exp(); 	  	
		});
		 
        $('#form').form({
        	onLoadSuccess:function(data){
               
           }
        }).form('loadDataEdit', {
            data: editData
        });
        
      //保存按钮
     	$('#saveBtn').on('click', submit);
     	/* $('#funcbar').prepend($.funcbar({
            type: 'button',
            data: permission,
            permit: ['${name_english}:sendExpress']
        }));
  	  $('#funcbar').on('click', 'a[data-permit="${name_english}:sendExpress"]', {isContinue: false},  submit); */
    });
    
  //返回主页面
    function backMain() {
    	window.location.href = CONST_URL.INIT_MAIN;
    }
  //表单提交
    function submit() {	  
		  //获取删除商品编号
		 var skuIds = "";
 		 for(var k=0;k<skulist.length;k++){
 			 if($("#skuId"+k+"").is(':checked')){
 				 if(skuIds == ""){
 					skuIds = $("input[name='skuId"+k+"']:checked").attr('value');
 				 }else{
 					skuIds = skuIds + "," + $("input[name='skuId"+k+"']:checked").attr('value');
 				 }
 			 }
 		 }
		  var userid = $("#userId").val();
	  $("#form").form({
		  	 buttons : ['#saveBtn'],
             ajax: {
                 url: CONST_URL.SEND_EXPRES+"?skuIds="+skuIds+"&userid="+userId
             },
             onSubmitSuccess: function (data) {
            	 if(data.msg != "null"){
            		 alert(data.msg);
            	 }else{
            		 $.stip({
        	                type:'ok',//显示类型 有info、 ok、 danger
        	                text: '保存成功！',
        	                onBeforeHide: function () {
        	                	backMain();
        	                }
                 	 });
            	 }
              }
         }).form("submit");
    }
  //修改收货信息
  
  //延迟发货提醒
  function addNote(){
	  $("#form").form({
          ajax: {
              url: CONST_URL.ADD_NOTE,
              param: {
  				"orderNo": trimSpace($('#orderNo').val())
              	//"startTime": trimSpace($('#startTime').val()),
              	//"stopTime": trimSpace($('#stopTime').val())
          	},
          },
          onSubmitSuccess: function (data) {
         	 $.stip({
	                type:'ok',//显示类型 有info、 ok、 danger
	                text: '保存成功！',
	                onBeforeHide: function () {
	                	backMain();
	                }
         	 });
           }
      }).form("submit");
  }
    // 重新加载表格
	function reloadTable() {
		$('#dataList').datagrid('reload',{
            ajax: {
            	param: {
            		"status": trimSpace($('#status').combobox('getValue')),
            		"orderNum":  trimSpace($('#orderNum').val())
            	}
            }
        });
	}
    
	//创建表格
    function createTable() {
    	$('#dataList').datagrid({
    		ajax: {
    			url: CONST_URL.LIST,
    			param: {
    				"userNickName": trimSpace($('#userNickName').val())
                	//"startTime": trimSpace($('#startTime').val()),
                	//"stopTime": trimSpace($('#stopTime').val())
            	},
            	success: function(msg){ //成功 
        			alert( "Data Saved: " + msg ); 
        			} 
    		},
    		
    		columns: [
    		     {
    		    	 field: 'id',
    		    	 hidden: true
    		     },
    		     {
    		    	 field:'orderNo'
    		     },
    		     {
    		    	 field:'createTime'
    		     },
    		     
    		     {
    		    	 render: function (rowData) {
                         for(var i=0;i<rowData.list.length;i++){
                           return '<div class="proleft">'+'<img src = "'+rowData.list[i].goodsImg+'">'+'</div>'
                               +'<div class="proright">'+'<p>"'+rowData.list[i].goodsName+'"</p>'+'<p>商品数量："'+rowData.list[i].count+'"</p>'+'<p>货号："'+rowData.list[i].goodsId+'"</p>'+'</div>';
                         }
                         
                       }
    		     },
    		     {
    		    	 render: function (rowData) {
                         for(var i=0;i<rowData.list.length;i++){
                           return '<div class="proleft">'
                           +'<div class="proright">'+'<p>优惠券："'+rowData.list[i].yjAmount+'"</p>'+'<p>佣金比例："'+rowData.list[i].yjpercent+'"</p>'+'</div>';
                           }
                         
                       }
    		     },
    		     {
    		    	 render: function (rowData) {
                         for(var i=0;i<rowData.list.length;i++){
                           return'<div class="proleft">'
                           +'<div class="proright">'+'<p>成交价："'+rowData.list[i].price+'"</p>'+'<p>原价："'+rowData.list[i].originPrice+'"</p>'
                           '"</p>'+'<p>"'+rowData.list[i].originPrice+'"</p>'+'</div>';
                           }                         
                       }
    		     },
    		     {
    		    	 render: function (rowData) {
                         for(var i=0;i<rowData.list.length;i++){
                           return rowData.list[i].state;
                           }                         
                       }
    		     },
    		     {
    		    	 field:'orderNo'
    		     },
    		     {
    		    	 field:'orderNo'
    		     },
    		    {
    		    	 render: function (rowData) {
    		    		 return $.funcbar({
    		    			 data: permission,    //请求的数据
    		    			 type: 'text',     //类型
    		    			 display: 2,    //显示数量
    		    			 permit: ['${name_english}:initView', '${name_english}:addnote'] //需要的权限按钮
    		    		 });
    		    	 }
    		    }
    		          
    	    ]
    	});
    }
   
    function closeWindow(object, isReload) 
    {
        object.close();
        isReload===true  && window.location.reload();
    }
    //导出方法
    function exp() {
        //得到查询条件中的value和创建表单
        
        var orderNum = trimSpace($('#orderNum').val()),
            status = $('#status').combobox('getValue');
    	    //startTime = trimSpace($('#startTime').val()),
    	    //stopTime = trimSpace($('#stopTime').val());
        
        var form = document.createElement('form');//创建表单
        form.method = 'post';//表单提交方式
        form.action = CONST_URL.EXP;//路径
        document.body.appendChild(form);

        //创建查询条件(input隐藏)
        //全称
        if ( orderNum ) {
            var inputOrderNum = document.createElement('input');
            inputOrderNum.type = 'hidden';
            inputOrderNum.value = orderNum;
            inputOrderNum.name = 'orderNum';
            form.appendChild(inputName );
        }
        
        if ( status ) {
            var inputStatus = document.createElement('input');
            inputStatus.type = 'hidden';
            inputStatus.value = status;
            inputStatus.name = 'status';
            form.appendChild(inputStatus);
        }
        		       
        //如果没有任何条件就提示用户
        if ( orderNum || status  ) {
            form.submit();
        } else {
            $.sdialog({
                 type : 'confirm',
                 msg : '未添加导出条件，默认为全部导出，确定吗？',
                 onConfirm : function(result) {
                     if (result) {
                         form.submit();
                     }
                 }
             });
        }
    }
   
</script>
</body>
</html>